package edu.kjxy.day01;

/**
 * 功能:
 * 作者:程序员欧阳子韩
 * 日期:2024/1/31 14:14
 */
public class MyThread4 extends Thread {
    private int count = 5;

    public MyThread4(String name) {
        super();
        this.setName(name);//设置线程名称
    }

    @Override
    public void run() {
        super.run();
        while (count > 0) {
            count--;
            System.out.println("由" + this.currentThread().getName()
                    + "计算, count=" + count);
        }
    }
}
